<script setup lang="ts">
import { elementLocale } from "@/locales/index";

const route = useRoute();

// 缓存布局页面
const getKey = () => route.matched[0]?.name ?? "unkonw";
</script>

<template>
  <el-config-provider :locale="elementLocale">
    <router-view v-slot="{ Component }">
      <keep-alive :include="['BasicLayout']">
        <component :is="Component" :key="getKey()"></component>
      </keep-alive>
    </router-view>
  </el-config-provider>
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
